<%@ page language="java" pageEncoding="utf-8"%>
<%@include file="/commons/taglib.jsp"%>

<html>
<head>
	<script type="text/javascript" src="${rootPath}/js/jquery.js"></script>
	<script type="text/javascript">
		function submitForm( lunciName ){
			if( lunciName != undefined ){
				$( "#lunci" ).attr( "value",lunciName );
			}else{
				$( "#lunci" ).attr( "value","1" );
			}
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_dzInfo.action" );

			$( "#teamDZForm" ).submit();
		}
		
		function cjTeamDzData(){		
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_cjTeamDzData.action" );
			$( "#teamDZForm" ).submit();
		}
		
		function cjOneGameData( teamDZId ){		
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_cjOneGameData.action?teamDZId="+teamDZId );
			$( "#teamDZForm" ).submit();
		}
		
		function jstj(){
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_jstjTeamDzData.action" );
			$( "#teamDZForm" ).submit();
		}
		
		function jstjOneTeamDzData( teamDZId ){		
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_jstjOneTeamDzData.action?teamDZId="+teamDZId );
			$( "#teamDZForm" ).submit();
		}
		
		function viewTeamDzData( teamDZId ){
			$( "#teamDZForm" ).attr( "action","${rootPath}/team_viewTeamDzData.action?teamDZId="+teamDZId );
			$( "#teamDZForm" ).submit();
		}
		
		window.onload=init;
		function init(){
			var id = "lunci_"+"${lunci}";
			document.getElementById( id ).className="tip";
		}
	</script>
	
	<style type="text/css">		
		.tip{
			color:#ff0000;
			font-size:30px;
		}
	</style>

</head>
<body>
	<center>
	<form action="${rootPath}/gameFire_list.action" method="post" name="teamDZForm" id="teamDZForm" >
		足球赛事年份：
		<select name="lianSaiYearId" id="lianSaiYearId" onchange="submitForm()">
			<c:forEach items="${lianSaiYearList}" var="lianSaiYear">
				<option value="${lianSaiYear.id}" <c:if test="${ lianSaiYearId == lianSaiYear.id }">selected</c:if> >
					${lianSaiYear.liansaiYear}
				</option>
			</c:forEach>
		</select><br/>
		
		足球联赛：
		<select name="lianSaiId" id="lianSaiId" onchange="submitForm()">
			<c:forEach items="${lianSaiList}" var="lianSai">
				<option value="${lianSai.id}" <c:if test="${ lianSaiId == lianSai.id }">selected</c:if> >
					${lianSai.chineseName}
				</option>
			</c:forEach>
		</select><br/>
		<input type="hidden" name="lunci" id="lunci" value="${lunci}" />
		<input type="button" name="search" value="查询" onclick="javascript:submitForm('${lunci}')"/>
		<input type="button" name="cj" value="采集数据" onclick="javascript:cjTeamDzData()"/>
		<input type="button" name="tj" value="技术统计" onclick="javascript:jstj()"/>
	</form>
	</center>
	<br/>
	
	<center>		
			<%
				int lunci = Integer.parseInt( (String)request.getAttribute( "sumLunci" ) );
				for( int i=1;i<=lunci;i++ ){
			%>
				<a href="#" onclick="javascript:submitForm('<%=i%>')" ><span id="lunci_<%=i%>"><%=i%></span></a>
			<%
				}
			%>		
			
			<table width="100%" id="data" >
				<tr>
					<th width="5%" align="center">轮次</th>
					<th width="15%" align="center">主队</th>										
					<th width="15%" align="center">客队</th>
					<th width="5%" align="center">比分</th>
					<th width="5%" align="center">赛果</th>
					<th width="10%" align="center">比赛时间</th>					
					<th width="10%" align="center">是否采集</th>
					<th width="10%" align="center">是否统计</th>	
					<th width="10%" align="center">地址</th>	
					<th width="15%" align="center">操作</th>
				</tr>
				<c:forEach items="${teamDZList}" var="teamDZ" varStatus="step">
					<tr >
						<td width="5%" align="center">${teamDZ.lunci}</td>
						<td width="15%" align="center">${teamDZ.zdName}</td>
						<td width="15%" align="center">							
							${teamDZ.kdName}							
						</td>
						<td width="5%" align="center" class="tip" >
							<a href="${teamDZ.urlBet007}" target="_blank">${teamDZ.source}</a>
						</td>
						
						<td width="5%" align="center">
							${teamDZ.result}
						</td>
						
						<td width="10%" align="center">
							<fmt:formatDate value="${teamDZ.playTime }" pattern="yyyy-MM-dd HH:ss"/>
						</td>
						
						<td width="10%" align="center">
							${teamDZ.cjStatus}
						</td>		
						
						<td width="10%" align="center">
							${teamDZ.tjStatus}
						</td>					
						
						<td width="10%" align="center">
							<a href="${teamDZ.fenxiUrl}" target="_blank">析</a>
							<a href="${teamDZ.yapanUrl}" target="_blank">亚</a>
							<a href="${teamDZ.oupanUrl}" target="_blank">欧</a>
							<a href="${teamDZ.daxiaoqiuUrl}" target="_blank">大小</a>
						</td>	
						
						<td width="15%" align="center">
							<a href="javascript:void(0);" onclick="javascript:cjOneGameData('${teamDZ.id}')" >采集</a>
							<a href="javascript:void(0);" onclick="javascript:jstjOneTeamDzData('${teamDZ.id}')" >统计</a>
							<a href="${rootPath}/team_viewTeamDzData.action?teamDZId=${teamDZ.id}" target="_blank">查看</a>
						</td>
						
					</tr>
				</c:forEach>
			</table>
			
	</center>
	
</body>
</html>